import Vue from 'vue'
import ElementUI from "element-ui"
import 'element-ui/lib/theme-chalk/index.css'
import echarts from 'echarts'
Vue.prototype.$echarts=echarts
import axios from 'axios'
// axios.defaults.baseURL = '/proxy_url'
axios.defaults.baseURL="http://127.0.0.1:5006"
Vue.prototype.axios=axios
import App from './App.vue'
import router from './router'
import store from './store'
router.beforeEach((to,from,next)=>{
  var user=sessionStorage.getItem('user')
  // if(user||to.path==='/wode'){
  //   ('/denglu')
  // }
  // else
  // next()
  if(user){
    next()
  }
  else{
    if(to.path==='/wode'||to.path==='/fatie'||to.path==='/shuju'){
      next('/denglu')
    }
    else{
      next()
    }
  }
})
Vue.config.productionTip = false
Vue.use(ElementUI)
new Vue({
  render: h => h(App),
  router:router,
  store:store
}).$mount('#app')
